#ifndef _FS_INCLUDED_
#define _FS_INCLUDED_

#include "types.hpp"

extern "C" {
#include "types.h"
#include "volume.h"
}

class FS:public QObject
{
	ntfs_volume *volume;	
	QDir::Filters m_filters;
	QDir qdir;
	
private:
	bool setDevice(Device& device);
	
public:
	FS(Device &d){
		volume=0; 
		m_filters = 0;
		setDevice(d);
	};
	virtual ~FS(){
		if(volume)
			ntfs_umount(volume, NO);
	};
	void setFilters(QDir::Filters filters);
	QStringList entryList(QString path, QDir::Filters filters = 0);	
	static bool recognize(Device&);
	int read(QString path, char* buff, size_t size, size_t offset = 0);
	int stat(QString path, FileInfo* buf);
};

#endif //_FS_INCLUDED_
